using System;
using System.Text;

namespace RealState.BusinessObjects
{
	[Serializable()]
	public class ImageTypes
	{
		private int _Id;

		public int Id
		{
			get { return _Id; }
			set { _Id = value; }
		}

		private string _Tile;

		public string Tile
		{
			get { return _Tile; }
			set { _Tile = value; }
		}

		public ImageTypes()
		{ }

		public ImageTypes(int Id,string Tile)
		{
			this.Id = Id;
			this.Tile = Tile;
		}

		public override string ToString()
		{
			return "Id = " + Id.ToString() + ",Tile = " + Tile;
		}

		public class IdComparer : System.Collections.Generic.IComparer<ImageTypes>
		{
			public SorterMode SorterMode;
			public IdComparer()
			{ }
			public IdComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<ImageTypes> Membres
			int System.Collections.Generic.IComparer<ImageTypes>.Compare(ImageTypes x, ImageTypes y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.Id.CompareTo(x.Id);
				}
				else
				{
					return x.Id.CompareTo(y.Id);
				}
			}
			#endregion
		}
		public class TileComparer : System.Collections.Generic.IComparer<ImageTypes>
		{
			public SorterMode SorterMode;
			public TileComparer()
			{ }
			public TileComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<ImageTypes> Membres
			int System.Collections.Generic.IComparer<ImageTypes>.Compare(ImageTypes x, ImageTypes y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.Tile.CompareTo(x.Tile);
				}
				else
				{
					return x.Tile.CompareTo(y.Tile);
				}
			}
			#endregion
		}
	}
}
